<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h4">应收结算</h1>
</div>
<div class="wrapper-sm" ng-controller="receivableCloseController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold curpoint" ng-click="collapseA()">查询<i class="pull-right fa fa-angle-right" ng-class="{'fa-angle-down': Ostatus, 'fa-angle-right': !Ostatus}"></i></div>
        <div class="panel-body collapse in" id="collapseD">
            <label class="control-label pull-left m-t-xs w-xs">客户单位</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.clientName" placeholder="请输入客户单位" name="clientName" id="clientName">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">结算单位</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.settle" placeholder="请输入结算单位" name="settle" id="settle">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">商务专员</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.businessaffairsid" ng-options="x.id as x.realName for x in businessOfficerList">
                    <option value="">全部</option>
                </select>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">合同号</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.contractnumber" placeholder="请输入合同号" name="contractnumber" id="contractnumber">
            </div>
            <div class="line line-xs pull-in"></div>
            <label class="control-label pull-left m-t-xs w-xs">车牌号</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.carcode" placeholder="请输入车牌号" name="carcode" id="name">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">发货起始时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input id="starttime" name="starttime" datetimepicker plugintype="datetime" ng-model="queryTerms.starttime" placeholder="起始时间" class="form-control" type="text" />
                    <span id="openstarttime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">发货结束时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input id="endtime" name="endtime" datetimepicker plugintype="datetime" ng-model="queryTerms.endtime" placeholder="结束时间" class="form-control" type="text" />
                    <span id="openendtime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">回单状态</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.receiptstatus" ng-options="x.value as x.text for x in receiptPriceStatusList">
                    <option value="">全部</option>
                </select>
            </div>
            <div class="line line-xs pull-in"></div>
            <label class="control-label pull-left m-t-xs w-xs">结算状态</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.settlestatus" ng-options="x.value as x.text for x in settleTypeList">
                    <option value="">全部</option>
                </select>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">发货地址</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.origin" placeholder="请输入发货地址" name="origin" id="origin">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">送货地址</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" ng-model="queryTerms.destination" placeholder="请输入送货地址" name="destination" id="destination">
            </div>
            <label class="control-label pull-left m-t-xs w-xs">应收费用类型</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.feeType" ng-options="x.value as x.text for x in feeTypeList">
                    <option value="">全部</option>
                </select>
            </div>
            <div class="line line-xs pull-in"></div>
            <label class="control-label pull-left m-t-xs w-xs">订单状态</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.orderStatus" ng-options="x.value as x.text for x in orderStatusList">
                    <option value="">全部</option>
                </select>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">实际发货起始时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input id="realStarttime" name="realStarttime" datetimepicker plugintype="datetime" ng-model="queryTerms.realStartTime" placeholder="起始时间" class="form-control" type="text" />
                    <span id="openRealStarttime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs">实际发货结束时间</label>
            <div class="col-md-2 col-xs-12 form-group">
                <div class="input-group input-group-sm date">
                    <input id="realEndtime" name="realEndtime" datetimepicker plugintype="datetime" ng-model="queryTerms.realEndTime" placeholder="结束时间" class="form-control" type="text" />
                    <span id="openRealEndtime" class="input-group-addon curpoint">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
            <label class="control-label pull-left m-t-xs w-xs"></label>
            <div class="col-md-2 form-group">
                <button ng-click="queryFunc()" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying" id="query">
                    <i class="fa fa-search" ng-show="!querying"></i>
                    <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                    <span ng-show="!querying">查询</span>
                    <span ng-show="querying">查询中...</span>
                </button>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            应收结算列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" ui-grid-selection ui-grid-exporter ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; min-width:1000px;  min-height:395px; overflow:hidden;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
        <div class="panel-body">
            <label class="pull-left control-label">已选中费用</label>
            <div class="col-lg-5">
                <span class="ui-select-bootstrap dropdown form-control">
                    <span ng-repeat="item in receivableIdList">
                        <span style="margin-right: 3px; margin-bottom:3px;" class="ui-select-match-item btn btn-default btn-xs">
                            <span class="close ui-select-match-close" ng-click="delId(item.code)">&nbsp;×</span>
                <span>{{item.code}}</span>
                </span>
                </span>
                </span>
            </div>
            <label class="control-label ">应收合计</label>
            <label class="control-label m-t-xs w-xs">{{totalReceivable}}</label>
            <div class="line pull-in"></div>
            <div class="form-group">
                <button ng-click="empty()" class="pull-right-xs btn btn-sm btn-danger btn-addon " id="empty"><i class="fa fa-trash-o"></i>清空费用编号</button>
                <button class="pull-right-xs btn btn-sm btn-success btn-addon" ng-click="auditPass()" ng-show="isauthAudit" id="auditPass"><i class="fa fa-check"></i>审核通过</button>
                <button class="pull-right-xs btn btn-sm btn-primary btn-addon" ng-click="auditBack()" ng-show="isauthAudit" id="auditBack"><i class="fa fa-mail-reply-all"></i>审核退回</button>
                <button ng-click="receivableChecking()" class="pull-right-xs btn btn-sm btn-success btn-addon " ng-show="isauthBill" id="receivableChecking"><i class="fa fa-file-archive-o"></i>生成应收账单</button>
                <button ng-click="receivableAdd()" class="pull-right-xs btn btn-sm btn-info btn-addon " ng-show="isauthBill" id="receivableAdd"><i class="fa fa-plus"></i>新增应收单</button>
                <button ng-click="exportFunc()" class="pull-right-xs btn btn-sm btn-success btn-addon " ng-show="isauthExpect" id="skipExcel"><i class="fa fa-download"></i>导出报表</button>
            </div>
        </div>
    </div>
</div>